package com.colorfruit.admin.business.service.impl;

import com.colorfruit.admin.business.dao.FoundationDictionaryMapper;
import com.colorfruit.admin.business.service.DictService;
import com.colorfruit.admin.pojo.entity.FoundationDictionary;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
@Slf4j
public class DictServiceImpl implements DictService {

    @Autowired
    FoundationDictionaryMapper foundationDictionaryMapper;

    @Override
    public List<FoundationDictionary> selectDictListByType(String dictType, String name) {
        try {
            log.info("[service] [IN] selectDictListByType param : dictType = {}", dictType);
            List<FoundationDictionary> foundationDictionaries = foundationDictionaryMapper.selectDictListByType(dictType, name);
            log.info("[service] [OUT] selectDictListByType success ");
            return foundationDictionaries;
        }catch (Exception e){
            log.error("# [OUT] errorMessage: " + e.getMessage(), e);
            throw e;
        }
    }
}
